<template>
	<view class="roots">
		<text class="nick_mame">{{user_info.uname}}</text>
		<view class="hot_state">
			<text class="words">贴吧等级：{{user_info.grade | grade}}</text>
			<text class="state"></text>
		</view>
		<view class="visit_count">
			<text class="words">被访问次数：</text>
			<text class="count">{{user_info.viewed}}</text>
		</view>
		<view class="visit_count">
			<text class="words">粉丝：</text>
			<text class="count">{{user_info.follwers}}</text>
		</view>
	</view>
</template>

<script>
	
	export default {
		name: "UserInfoForHomeComponent",
		data() {
			return {
				
			};
		},
		filters:{
			grade(i){
				let star = new Array(i.star).fill('✨').join('')
				let fire = new Array(i.fire).fill('🔥').join('')
				let moon = new Array(i.moon).fill('🌙').join('')
				let loin = new Array(i.loin).fill('🦁').join('')
				return `${star}${fire}${moon}${loin}`
			}
		},
		props:{
			user_info:{
				type:Object,
				required:true
			}
		}
	}
</script>

<style lang="scss" scoped>
	.roots {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: center;
		width: 100%;

		.nick_mame {
			font-weight: bolder;
			color: #fff;
			font-size: 20px;
			margin-bottom: 10rpx;
		}

		.hot_state,
		.visit_count {
			display: flex;

			.words {
				color: #fff;
				font-size: 14px;
			}
			.count{
				color: #fff;
				font-size: 15px;
			}
		}
	}
</style>